# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>

pkgname=python-nbval
pkgver=0.10.0
pkgrel=5
pkgdesc="A py.test plugin to validate Jupyter notebooks"
url="https://github.com/computationalmodelling/nbval"
license=('BSD')
arch=('any')
depends=('python-pytest' 'python-jupyter_client' 'jupyter-nbformat' 'python-ipykernel'
         'python-coverage')
makedepends=('python-setuptools' 'python-nbdime')
checkdepends=('python-doit' 'python-matplotlib' 'python-pytest-cov' 'python-pytest-mock' 'python-sympy')
optdepends=(
  'python-nbdime: for --nbdime option'
)
source=("https://github.com/computationalmodelling/nbval/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('65da8cbb2196b0fab591017e3ec83a6ae908db863bf53a989eb48d5037d99587d23abb3729eda38556f3c11c0a769eea60fa77f02c05836178519aac6e923e87')

build() {
  cd nbval-$pkgver
  python setup.py build
}

check() {
  cd nbval-$pkgver
  python setup.py egg_info

  PYTHONPATH="$PWD" doit test
}

package() {
  cd nbval-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
